package hos.table.holder;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractSorterViewHolder;

import hos.table.BaseTableAdapter;

/**
 * <p>Title: BaseTablSorterHolder </p>
 * <p>Description:  </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2022/7/6 22:53
 */
public abstract class BaseTableSorterHolder<T> extends AbstractSorterViewHolder implements DataHolder<T> {


    public BaseTableSorterHolder(@NonNull Context context, int layoutId) {
        super(View.inflate(context, layoutId, null));
    }

    public BaseTableSorterHolder(@NonNull View itemView) {
        super(itemView);
    }

    @Override
    public void onBindViewHolder(@NonNull BaseTableAdapter adapter, @NonNull View itemView, @Nullable T model, int columnPosition, int rowPosition) {
        if (model == null) {
            return;
        }
        onConvert(adapter, itemView, model, columnPosition, rowPosition);
        layoutParams(adapter, itemView, model, columnPosition, rowPosition);
    }

}
